import { requestData } from './request'

export function getDetailData (iid){
	return requestData({
		url:'/detail/',
		params:{
			iid
		}
	})
}

export function getRecommendData(){
	return requestData({
		url:'/recommend'
	})
}

// 商品价格，名称等详细信息的类
export class Goodsinfo{
	constructor(columns,itemInfo,services){
		this.title = itemInfo.title
		this.price = itemInfo.price
		this.highPrice = itemInfo.highPrice
		this.discountDesc = itemInfo.discountDesc
		this.discountBgColor = itemInfo.discountBgColor
		this.services = services
		this.columns = columns

	}
}

// 商品店铺信息的类
export class Shopinfo{
	constructor(shop){
		this.cGoods =shop.cGoods
		this.cSells =shop.cSells
		this.services=shop.services
		this.name=shop.name
		this.shopLogo=shop.shopLogo
		this.score=shop.score
	}
}

// 有关商品加购的信息的类
export class AddcartInfo{
	constructor(iid,itemInfo){
		this.id =iid
		this.lowNowPrice =itemInfo.lowNowPrice
		this.title =itemInfo.title
		this.topImages =itemInfo.topImages[0]
	}
}

